package cheeese.and.crackers;

public class Filter {
	
	private String startDate;
	private String type;
	private Boolean complete;
	
	public Filter(String startDate, String category, Boolean complete){
		this.startDate = startDate;
		this.type = category;
		this.complete = complete;
	}

	public boolean matches(Task currentTask) {
		if((startDate == null) || (startDate.compareTo(currentTask.getDueDate()) <= 0)){
			if((type == null) || (type.equals(currentTask.getType()))){
				if((complete == null) || (!currentTask.getComplete()) || (currentTask.getComplete().booleanValue() == complete)){
					return true;
				}
			}
		}
		return false;
	}

	public String getStartDate() {
		return startDate;
	}

	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Boolean getComplete() {
		return complete;
	}

	public void setComplete(Boolean complete) {
		this.complete = complete;
	}

}
